
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String [] args){
        Scanner in=new Scanner(System.in);
        Employee [] e=new Employee[3];
        e[0]=new SalariedEmployee(in.next(),in.next(),in.nextDouble());
        e[1]=new HourlyEmployee(in.next(),in.next(),in.nextDouble(),in.nextDouble());
        e[2]=new CommissionEmployee(in.next(),in.next(),in.nextDouble(),in.nextDouble());
        for(int i=0;i<e.length;i++)
        {
            System.out.println(e[i].getSalary());
            System.out.println(e[i]);
        }

    }
}
class Employee{
    String name;
    String id;

    public Employee(String name, String id) {
        this.name = name;
        this.id = id;
    }

    public double getSalary(){
        return  0;
    }
}
class SalariedEmployee extends Employee{
    double monthSalary;

    public SalariedEmployee(String name,String id,double monthSalary) {
        super(name,id);
        this.monthSalary = monthSalary;
    }
    public double getSalary(){
        return monthSalary;
    }
    public String toString(){
        return "SalariedEmployee[name="+name+",id="+id+"][monthSalary="+getSalary()+"]";
    }
}
class HourlyEmployee extends Employee{
    double hourSalary;
    double workHour;

    public HourlyEmployee(String name,String id,double hourSalary, double workHour) {
        super(name,id);
        this.hourSalary = hourSalary;
        this.workHour = workHour;
    }
    public String toString(){
        return "HourlyEmployee[name="+name+",id="+id+"][hourSalary="+hourSalary+",workhour="+workHour+"]";
    }
    public double getSalary(){
        return hourSalary*workHour;
    }
}
class CommissionEmployee extends Employee{
    double commissionRatio;
    double totalSales;

    public CommissionEmployee(String name, String id, double commissionRatio, double totalSales) {
        super(name, id);
        this.commissionRatio = commissionRatio;
        this.totalSales = totalSales;
    }
    public String toString(){
        return "CommissionEmployee[name="+name+",id="+id+"][commissionRatio="+commissionRatio+",sale="+totalSales+"]";
    }
    public double getSalary(){
        return commissionRatio*totalSales;
    }
}
